Integrand size = 31, antiderivative size = 60 \[ \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=b (A b+2 a B) x+\frac {a (2 A b+a B) \text {arctanh}(\sin (c+d x))}{d}+\frac {b^2 B \sin (c+d x)}{d}+\frac {a^2 A \tan (c+d x)}{d} \]
[Out]
Time = 0.20 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {3067, 3102, 2814, 3855} \[ \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {a^2 A \tan (c+d x)}{d}+\frac {a (a B+2 A b) \text {arctanh}(\sin (c+d x))}{d}+b x (2 a B+A b)+\frac {b^2 B \sin (c+d x)}{d} \]
[In]
[Out]
Rule 2814
Rule 3067
Rule 3102
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \frac {a^2 A \tan (c+d x)}{d}-\int \left (-a (2 A b+a B)-b (A b+2 a B) \cos (c+d x)-b^2 B \cos ^2(c+d x)\right ) \sec (c+d x) \, dx \\ & = \frac {b^2 B \sin (c+d x)}{d}+\frac {a^2 A \tan (c+d x)}{d}-\int (-a (2 A b+a B)-b (A b+2 a B) \cos (c+d x)) \sec (c+d x) \, dx \\ & = b (A b+2 a B) x+\frac {b^2 B \sin (c+d x)}{d}+\frac {a^2 A \tan (c+d x)}{d}+(a (2 A b+a B)) \int \sec (c+d x) \, dx \\ & = b (A b+2 a B) x+\frac {a (2 A b+a B) \text {arctanh}(\sin (c+d x))}{d}+\frac {b^2 B \sin (c+d x)}{d}+\frac {a^2 A \tan (c+d x)}{d} \\ \end{align*}
Time = 1.21 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.82 \[ \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {b (A b+2 a B) (c+d x)-a (2 A b+a B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+a (2 A b+a B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^2 B \sin (c+d x)+a^2 A \tan (c+d x)}{d} \]
[In]
[Out]
Time = 2.72 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.32
method | result | size |
parts | \(\frac {a^{2} A \tan \left (d x +c \right )}{d}+\frac {\left (A \,b^{2}+2 B a b \right ) \left (d x +c \right )}{d}+\frac {\left (2 A a b +B \,a^{2}\right ) \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {b^{2} B \sin \left (d x +c \right )}{d}\) | \(79\) |
derivativedivides | \(\frac {A \,a^{2} \tan \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 A a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 B a b \left (d x +c \right )+A \,b^{2} \left (d x +c \right )+B \sin \left (d x +c \right ) b^{2}}{d}\) | \(86\) |
default | \(\frac {A \,a^{2} \tan \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 A a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 B a b \left (d x +c \right )+A \,b^{2} \left (d x +c \right )+B \sin \left (d x +c \right ) b^{2}}{d}\) | \(86\) |
parallelrisch | \(\frac {\left (-4 A a b -2 B \,a^{2}\right ) \cos \left (d x +c \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\left (4 A a b +2 B \,a^{2}\right ) \cos \left (d x +c \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+B \sin \left (2 d x +2 c \right ) b^{2}+2 b d x \left (A b +2 B a \right ) \cos \left (d x +c \right )+2 A \,a^{2} \sin \left (d x +c \right )}{2 d \cos \left (d x +c \right )}\) | \(122\) |
risch | \(x A \,b^{2}+2 x B a b -\frac {i B \,b^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i B \,b^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i A \,a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A b}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}-\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A b}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}\) | \(160\) |
norman | \(\frac {\left (-A \,b^{2}-2 B a b \right ) x +\left (-2 A \,b^{2}-4 B a b \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (A \,b^{2}+2 B a b \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 A \,b^{2}+4 B a b \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {2 \left (A \,a^{2}-B \,b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (A \,a^{2}+B \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 \left (3 A \,a^{2}-B \,b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (3 A \,a^{2}+B \,b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \left (2 A b +B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a \left (2 A b +B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(283\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.95 \[ \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {2 \, {\left (2 \, B a b + A b^{2}\right )} d x \cos \left (d x + c\right ) + {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (B b^{2} \cos \left (d x + c\right ) + A a^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
[In]
[Out]
\[ \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\int \left (A + B \cos {\left (c + d x \right )}\right ) \left (a + b \cos {\left (c + d x \right )}\right )^{2} \sec ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.20 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.72 \[ \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {4 \, {\left (d x + c\right )} B a b + 2 \, {\left (d x + c\right )} A b^{2} + B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, B b^{2} \sin \left (d x + c\right ) + 2 \, A a^{2} \tan \left (d x + c\right )}{2 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 152 vs. \(2 (60) = 120\).
Time = 0.30 (sec) , antiderivative size = 152, normalized size of antiderivative = 2.53 \[ \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {{\left (2 \, B a b + A b^{2}\right )} {\left (d x + c\right )} + {\left (B a^{2} + 2 \, A a b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (B a^{2} + 2 \, A a b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \]
[In]
[Out]
Time = 1.03 (sec) , antiderivative size = 169, normalized size of antiderivative = 2.82 \[ \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx=\frac {A\,a^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {2\,A\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {B\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d\,\cos \left (c+d\,x\right )}+\frac {4\,B\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {A\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,4{}\mathrm {i}}{d} \]
[In]
[Out]